home *** CD-ROM | disk | FTP | other *** search
- /***
-
- This is a quickie example of how to use the GetRotatedStringBitmap function.
-
- This is also based on some Apple sample code, but has been modified slightly.
-
- - Guy Fullerton
-
- ***/
-
-
- #include "GetRotatedStringBitmap.h"
-
-
- void main( void )
- {
- WindowPtr window1;
- WindowPtr window2;
- BitMap destMap;
- Rect windowRect;
-
- // do some toolbox initialization
- InitGraf( &qd.thePort );
- InitFonts();
- FlushEvents( everyEvent, 0xFFFF );
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs( nil );
- InitCursor();
-
- // create a window to hold the counter clockwise string
- SetRect( &windowRect, 100, 100, 200, 200);
- window1 = NewWindow( nil, &windowRect, "\p", true,
- noGrowDocProc,(WindowPtr)-1, true, nil );
-
- // set up the font the way we want it
- SetPort(window1);
- TextFont(applFont);
- TextSize(12);
-
- // rotate the string
- GetRotatedStringBitmap( "\pFirst", &destMap, rotationDirection_CounterClockWise);
-
- // size the window so we're the same size as the bitmap
- SizeWindow(window1,destMap.bounds.right,destMap.bounds.bottom,false);
-
- // draw the bitmap into the window
- CopyBits( &destMap, &window1->portBits, &destMap.bounds,
- &destMap.bounds, srcCopy, nil );
-
- // create a winow to hold the clockwise string
- OffsetRect(&windowRect,(windowRect.right - windowRect.left ) + 40,0);
- window2 = NewWindow( nil, &windowRect, "\p", true,
- noGrowDocProc,(WindowPtr) (WindowPtr)-1, true, nil );
-
- // set up the font the way we want it
- SetPort(window2);
- TextFont(applFont);
- TextFace(bold+outline);
- TextSize(32);
-
- // rotate the string
- GetRotatedStringBitmap( "\pBold", &destMap, rotationDirection_ClockWise);
-
- // size the window so we're the same size as the bitmap
- SizeWindow(window2,destMap.bounds.right,destMap.bounds.bottom,false);
-
- // draw the bitmap into the window
- CopyBits( &destMap, &window2->portBits, &destMap.bounds,
- &destMap.bounds, srcCopy, nil );
-
- // wait til the user clicks the mouse button
- while( !Button() );
-
- }
-
-
-